package com.gm.corejava.book1;

/**
 * Created with IntelliJ IDEA.
 * User: camark@sina.cn
 * Date: 14-1-2
 * Time: 下午12:57
 * python
 * for i in range(1,10):
 *  for j in range(0,10):
 *      for k in range(0,10):
 *          for l in range(0,10):
 *              sum1=i*10**3+j*10**2+k*10+l
 *              sum2=l*10**3+k*10**2+j*10+i
 *              if sum1*9 == sum2:
 *                  print sum1
 */
public class Welcome {
    public static void main(String[] args) {
        //PrintSomeHello();

        //ABCDX9EQualsDCBA();

        new CalendarPrinter().Print();
    }

    private static void PrintSomeHello() {
        String[] messages=new String[3];

        messages[0]="Welcome to Core Java";
        messages[1]="by Cay Horstmann";
        messages[2]="and Grey Cornell";

        for (String s : messages)
            System.out.println(s);
    }

    private static void ABCDX9EQualsDCBA() {
        int sum1=0,sum2=0;
        for(int i=1;i<=9;i++)  {
            for(int j=0;j<=9;j++)  {
                for(int k=0;k<=9;k++) {
                    for(int l=0;l<=9;l++){
                        sum1=i*10*10*10+j*10*10+k*10+l;
                        sum2=l*10*10*10+k*10*10+j*10+i;

                        if(sum1*9==sum2){
                            System.out.println(sum1);
                            System.out.println(sum2);
                        }
                    }
                }
            }
        }
    }
}
